When user data stored in a nonvolatile memory is read from the memory, a phenomenon in which the read user data is changed to a value other than an original value or the like may occur.
In order to cope with this problem, a method of performing error-correction encoding on user data to generate parity data and managing the user data and the parity data as a set is generally used. A Bose Chaudhuri Hocquenghem (BCH) code or Reed-Solomon (RS) code is used as an error correcting code. A product code has been proposed as a method of combining codes to improve correction capability.